package org.nidy.erp.utils;

import lombok.Data;

@Data
public class ResponseResult {
//    状态响应码：1成功，0失败
    private Integer code;
    private String msg;
    private Object data;

    public static ResponseResult success()
    {
        ResponseResult responesResult = new ResponseResult();
        responesResult.setCode(1);
        responesResult.setMsg("成功");
        return responesResult;
    }
    public static ResponseResult success(Object data)
    {
        ResponseResult responesResult = new ResponseResult();
        responesResult.setCode(1);
        responesResult.setMsg("成功");
        responesResult.setData(data);
        return responesResult;
    }
    public static ResponseResult error(String msg)
    {
        ResponseResult responesResult = new ResponseResult();
        responesResult.setCode(0);
        responesResult.setMsg(msg);
        return responesResult;
    }

}
